home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / c / stormamiga_lib-v45_00d / include / dirent.h < prev    next >
C/C++ Source or Header  |  2000-02-28  |  1KB  |  63 lines

  1. #ifndef DIRENT_H
  2. #define DIRENT_H
  3.  
  4. /*
  5. **          $VER: dirent.h 1.3 (18.09.98)
  6. **             Includes Release 45.00
  7. **
  8. **    Copyright © 1996/2000 by CyberdyneSystems
  9. **
  10. **            written by Matthias Henze
  11. **               All Rights Reserved
  12. */
  13.  
  14. #ifndef STORMAMIGA_H
  15.   #include <stormamiga.h>
  16. #endif
  17. #ifndef SYS_DIRENT_H
  18.   #include <sys/dirent.h>
  19. #endif
  20.  
  21. #ifdef __cplusplus
  22.   extern "C" {
  23. #endif
  24.  
  25. #ifdef _POSIX_SOURCE
  26.   typedef void *  DIR;
  27. #else
  28.  
  29. /* backwards compatibility */
  30. #define d_ino           d_fileno
  31.  
  32. /* definitions for library routines operating on directories. */
  33. #define DIRBLKSIZ       1024
  34.  
  35. /* structure describing an open directory. */
  36. typedef struct _dirdesc
  37. {
  38.   int     dd_fd;        /* file descriptor associated with directory */
  39.   struct dirent dd_ent;
  40. } DIR;
  41.  
  42. #define dirfd(dirp)     ((dirp)->dd_fd)
  43. #endif /* _POSIX_SOURCE */
  44.  
  45. DIR     *opendir        (cchar *);
  46. struct dirent *readdir  (DIR *);
  47. void    rewinddir       (DIR *);
  48. int     closedir        (DIR *);
  49.  
  50. #ifdef __cplusplus
  51.   }
  52. #endif
  53.  
  54. #ifdef STORMAMIGA_UNIXPATH
  55.   __inline DIR *opendir_u (cchar *name)
  56.   { return opendir        (name); }
  57.  
  58.   #define opendir(name)   opendir_u(UnixToAmigaPath(name))
  59. #endif
  60.  
  61. #endif  /* DIRENT_H */
  62.  
  63.